package com.css.dzj.zfjg.modules.detail.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 * 企业信用反馈记录信息
 */
@Entity
@Table(name = "jg_xyjg_pushinfo", schema = "DZJZFJG", catalog = "")
public class CreditPushInfo {
    private String id;
    // 企业证件号码
    private String enterpriseIdNumber;
    // 反馈人
    private String feedbackPerson;
    // 反馈人机构
    private String feedbackOrg;
    // 反馈时间
    private Date feedbackTime;

    @Id
    @Column(name = "Id")
    @GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator", strategy = "com.css.dzj.zfjg.common.util.SnowflakeId")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }


    @Basic
    @Column(name = "Enterprise_Id_Number")
    public String getEnterpriseIdNumber() {
        return enterpriseIdNumber;
    }

    public void setEnterpriseIdNumber(String enterpriseIdNumber) {
        this.enterpriseIdNumber = enterpriseIdNumber;
    }


    @Basic
    @Column(name = "Feedback_Person")
    public String getFeedbackPerson() {
        return feedbackPerson;
    }

    public void setFeedbackPerson(String feedbackPerson) {
        this.feedbackPerson = feedbackPerson;
    }

    @Basic
    @Column(name = "Feedback_Org")
    public String getFeedbackOrg() {
        return feedbackOrg;
    }

    public void setFeedbackOrg(String feedbackOrg) {
        this.feedbackOrg = feedbackOrg;
    }

    @Basic
    @Column(name = "Feedback_Time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getFeedbackTime() {
        return feedbackTime;
    }

    public void setFeedbackTime(Date feedbackTime) {
        this.feedbackTime = feedbackTime;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CreditPushInfo that = (CreditPushInfo) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(enterpriseIdNumber, that.enterpriseIdNumber) &&
                Objects.equals(feedbackPerson, that.feedbackPerson) &&
                Objects.equals(feedbackOrg, that.feedbackOrg) &&
                Objects.equals(feedbackTime, that.feedbackTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, enterpriseIdNumber, feedbackPerson, feedbackOrg, feedbackTime);
    }
}
